export const checkNumber: (data: unknown) => number = data => {
    const tmpData = Number(data);
    if (typeof data === 'number' || !Number.isNaN(tmpData)) {
        return tmpData;
    }

    return 0;
};

export const numberFormatter: (data: unknown | string | number) => unknown | string | number = data => {
    const tmpData = Number(data);
    if ((typeof data === 'number' || typeof data === 'string') && !Number.isNaN(tmpData)) {
        // return new Intl.NumberFormat('en-IN').format(tmpData);
        return null;
    }

    return data;
};

export const numberTofixed: (data: number) => string = data => Number(data).toFixed(data);
